<!DOCTYPE html>
<html lang="zh">
<head th:replace="~{frag::head}"></head>
  
<body>
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
	<aside th:replace="~{frag::sidebar}"></aside>
    <!--End 左侧导航-->
    
    <!--头部信息-->
    <header th:replace="~{frag::header}"></header>
    <!--End 头部信息-->
    
    <!--页面主要内容-->
    <main class="lyear-layout-content">
      
      <div class="container-fluid">

        <div class="row">
          
          <div class="col-lg-12">
            <div class="card">
              <div class="card-header">
                <h4>医疗机构信息查询</h4>
                </div>
                  <div class="card-body">
                      <form class="form-horizontal" action="/medicalInstitution" method="post">
					<div class="form-group">
					    <label class="col-md-2 control-label" for="diaId">医疗机构编号</label>
					  <div class="col-md-4">
					    <input class="form-control" type="text" id="diaId" name="diaId" placeholder="请输入医疗机构编号..">
					  </div>
					    <label class="col-md-2 control-label" for="diaName">医疗机构名称</label>
					  <div class="col-md-4">
					    <input class="form-control" type="text" id="diaName" name="diaName" placeholder="请输入医疗机构名称..">
					  </div>
					</div>
                        <div class="form-group">
                          <div class="col-md-11 col-md-offset-1">
                            <button class="btn btn-primary" type="submit">查询</button>
                            <button class="btn btn-secondary" type="reset">重置</button>
                            <a class="btn btn-info btn-w-md" href="/medicalInstitution/addInit">添加新医疗机构</a>
                          </div>
                        </div>
                      </form>
                  </div>
              </div>
            </div>
          </div>
          
        </div>

        <div class="row">
          
          <div class="col-lg-12">
            <div class="card">
              <div class="card-header">
                <h4>查询结果</h4>
              </div>
              <div class="card-body">
                <div class="table-responsive">
                  <table class="table table-hover">
                    <thead>
                      <tr>
					<th>序号</th>
                        <th>医疗机构编号</th>
                        <th>医疗机构名称</th>
                        <th>收费类别</th>
                        <th>有效标志</th>
                        <th>操作</th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr th:each="dia,stat : ${medInsList}">
                        <td>[[${stat.count}]]</td>
                        <td>[[${dia.diaId}]]</td>
                        <td>[[${dia.diaName}]]</td>
                        <td>[[${dia.diaExpType == 0?"公立医院":
                                dia.diaExpType == 1?"私立医院":
                                dia.diaExpType == 2?"社区卫生服务中心":
                                dia.diaExpType == 3?"乡镇卫生院":
                                dia.diaExpType == 4?"诊所":
                                dia.diaExpType == 5?"卫生室":
                                dia.diaExpType == 6?"专科医院":
                                dia.diaExpType == 7?"妇幼保健院":
                                dia.diaExpType == 8?"疾病预防控制中心":
                                dia.diaExpType == 9?"体检中心":
                                "其他"}]]
                        </td>
					<td>[[${dia.diaValid?"有效":"无效"}]]</td>
                        <td>
                          <a th:href="@{/medicalInstitution/updateInit(diaId=${dia.diaId})}">编辑</a>&nbsp;
                          <a th:href="@{/medicalInstitution/delete(diaId=${dia.diaId})}"
					  		onclick="return window.confirm('是否确认删除当前医疗机构信息？');")>删除</a>&nbsp;
                          <a th:href="@{/medicalInstitution/detail(diaId=${dia.diaId})}">详情</a>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
        </div>
    </main>
      </div>

    <!--End 页面主要内容-->
  </div>
</div>

<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/js/main.min.js"></script>

<!--图表插件-->
<script type="text/javascript" src="/js/Chart.js"></script>
<script th:if="${addResult != null}">
	window.alert("[[${addResult}]]");
</script>
<script type="text/javascript">
$(document).ready(function(e) {
    var $dashChartBarsCnt  = jQuery( '.js-chartjs-bars' )[0].getContext( '2d' ),
        $dashChartLinesCnt = jQuery( '.js-chartjs-lines' )[0].getContext( '2d' );
    
    var $dashChartBarsData = {
		labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
		datasets: [
			{
				label: '注册用户',
                borderWidth: 1,
                borderColor: 'rgba(0,0,0,0)',
				backgroundColor: 'rgba(51,202,185,0.5)',
                hoverBackgroundColor: "rgba(51,202,185,0.7)",
                hoverBorderColor: "rgba(0,0,0,0)",
				data: [2500, 1500, 1200, 3200, 4800, 3500, 1500]
			}
		]
	};
    var $dashChartLinesData = {
		labels: ['2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014'],
		datasets: [
			{
				label: '交易资金',
				data: [20, 25, 40, 30, 45, 40, 55, 40, 48, 40, 42, 50],
				borderColor: '#358ed7',
				backgroundColor: 'rgba(53, 142, 215, 0.175)',
                borderWidth: 1,
                fill: false,
                lineTension: 0.5
			}
		]
	};
    
    new Chart($dashChartBarsCnt, {
        type: 'bar',
        data: $dashChartBarsData
    });
    
    var myLineChart = new Chart($dashChartLinesCnt, {
        type: 'line',
        data: $dashChartLinesData,
    });
});
</script>
</body>
</html>